<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>网络性能分析</title>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	function search(){

		var startTime=$("#i1").datebox("getValue");
		var endTime=$("#i2").datebox("getValue");
		
// 		if(startTime==""&&endTime==""){  
// 			startTime=$('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
// 			endTime=$('#i2').datetimebox('setValue', formatterDate(new Date()));
// 	   	}
		//若时间为空，默认输入当前时间
		var startTimeLong = new Date(startTime.replace(new RegExp("-","gm"),"/")).getTime()-10;
		var endTimeLong = new Date(endTime.replace(new RegExp("-","gm"),"/")).getTime()-10;
		//转换为时间戳
		 if(startTimeLong-endTimeLong>=0){
			 $.messager.alert("系统提示","查询开始时间"+startTime+"不能大于结束时间"+endTime+"！");
			 return;
		 }		 
		 
		 $("#dg").datagrid('load',{
			"district":$("#district").combotree("getText"),
			"SacchType":$("#SacchType").combotree("getText"),
			"SignalingType":$("#SignalingType").combotree("getText"),
			"ServiceType":$("#ServiceType").combotree("getText"),
			"GPRSDefaultType":$("#GPRSDefaultType").combotree("getText"),
			"GPRSFullType":$("#GPRSFullType").combotree("getText"),
			"timegap":$("#timegap").combobox("getText"),
			"judge":$("#judge").combobox("getText"),
		 	"startTime":startTimeLong,
		 	"endTime":endTimeLong
		 });
		 //传入参数
		 
	}
	
	
	
	function getCommonData() {
    	var district = $("#district").combotree("getText");
		var startTime=$("#i1").datebox("getValue");
		var endTime=$("#i2").datebox("getValue");
		var SacchType = $("#SacchType").combotree("getText");
		var SignalingType = $("#SignalingType").combotree("getText");
		var ServiceType = $("#ServiceType").combotree("getText");
		var GPRSDefaultType = $("#GPRSDefaultType").combotree("getText");
		var GPRSFullType = $("#GPRSFullType").combotree("getText");
		
		var startTimeLong = new Date(startTime.replace(new RegExp("-","gm"),"/")).getTime();
		var endTimeLong = new Date(endTime.replace(new RegExp("-","gm"),"/")).getTime();
		var timegap =$("#timegap").combobox("getText");
		var judge = $("#judge").combobox("getText");
		
		return {"startTime":startTimeLong, "endTime":endTimeLong, "SacchType":SacchType, "SignalingType":SignalingType, "ServiceType":ServiceType, 
			"timegap":timegap, "district":district, "judge":judge};
    }
	
	function exportCurrentPage(){
		var rows  = $('#dg').datagrid("getRows");
		if (rows.length < 1) {
			$.messager.alert("系统提示", "请查询需要导出的数据");
			return;
		}
		
		var data = getCommonData();
		window.open('${pageContext.request.contextPath}/networkanalysis/export.do?startTime='+data.startTime+'&endTime='+data.endTime+'&SacchType='+data.SacchType+'&SignalingType='+data.SignalingType+'&ServiceType='+data.ServiceType+'&timegap='+data.timegap+'&district='+data.district+'&judge='+data.judge);
	}
	
	function numberSort(a,b){
		 var number1 = parseFloat(a);
		 var number2 = parseFloat(b);
		 
		 return (number1 > number2 ? 1 : -1);  
	}//没用到
	
	
	$(function(){
		 $('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
		 $('#i2').datetimebox('setValue', formatterDate(new Date()));
			
		 $('#district').combotree({		 
		    url:'${pageContext.request.contextPath}/networkanalysis/frontId.do'
		 })
		 
// 		 formatterDate = function (date) {
// 		var day = date.getDate();
// 		var month = (date.getMonth() + 1);
// 		var hor = date.getHours();
// 		var min = date.getMinutes();
// 		var sec = date.getSeconds();
// 		return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
// 	};
	
// 	$(function(){
// 		$('#i1').datetimebox('setValue', formatterDate(new Date(new Date(new Date().toLocaleDateString()).getTime())));
// 		$('#i2').datetimebox('setValue', formatterDate(new Date()));
	
// 		$('.searchbox-button').remove()
	
// 	});
		 
// 		 $('#SacchType').combotree('loadData', [
// 			 {id:'1', text:'下行接收电平0级比例'},
// 			 {id:'2', text:'下行接收电平1级比例'},
// 			 {id:'3', text:'下行接收电平2级比例'},
// 			 {id:'4', text:'下行接收电平3级比例'},
// 			 {id:'5', text:'下行接收电平4级比例'},
// 			 {id:'6', text:'下行接收电平5级比例'},
// 			 {id:'7', text:'下行接收电平6级比例'},
// 			 {id:'8', text:'下行接收电平7级比例'},
// 			 {id:'9', text:'下行接收质量0级比例'},
// 			 {id:'10', text:'下行接收质量1级比例'},
// 			 {id:'11', text:'下行接收质量2级比例'},
// 			 {id:'12', text:'下行接收质量3级比例'},
// 			 {id:'13', text:'下行接收质量4级比例'},
// 			 {id:'14', text:'下行接收质量5级比例'},
// 			 {id:'15', text:'下行接收质量6级比例'},
// 			 {id:'16', text:'下行接收质量7级比例'},
// 			 {id:'17', text:'接收TA值0级比例'},
// 			 {id:'18', text:'接收TA值1级比例'},
// 			 {id:'19', text:'接收TA值2级比例'},
// 			 {id:'20', text:'接收TA值3级比例'},
// 			 {id:'21', text:'接收TA值4级比例'},
// 			 {id:'22', text:'接收TA值5级比例'},
// 			 {id:'23', text:'接收TA值6级比例'},
// 			 {id:'24', text:'接收TA值7级比例'},
// 			 {id:'25', text:'接收TA值8级比例'},
// 			 {id:'26', text:'接收TA值9级比例'},
// 			 {id:'27', text:'接收TA值10级比例'},
// 			 {id:'28', text:'接收TA值11级比例'},
// 			 {id:'29', text:'接收TA值12级比例'},
// 			 {id:'30', text:'接收TA值13级比例'},
// 			 {id:'31', text:'接收TA值14级比例'},
// 			 {id:'32', text:'接收TA值15级比例'},
// 			 {id:'33', text:'接收TA值16级比例'},
// 			 {id:'34', text:'接收TA值17级比例'},
// 			 {id:'35', text:'接收TA值18级比例'},
// 			 {id:'36', text:'接收TA值19级比例'},
// 			 {id:'37', text:'接收TA值20级比例'},
// 			 {id:'38', text:'接收TA值21级比例'},
// 			 {id:'39', text:'接收TA值22级比例'},
// 			 {id:'40', text:'接收TA值23级比例'},
// 			 {id:'41', text:'接收TA值24级比例'},
// 			 {id:'42', text:'接收TA值25级比例'},
// 			 {id:'43', text:'接收TA值26级比例'},
// 			 {id:'44', text:'接收TA值27级比例'},
// 			 {id:'45', text:'接收TA值28级比例'},
// 			 {id:'46', text:'接收TA值29级比例'},
// 			 {id:'47', text:'接收TA值30级比例'},
// 			 {id:'48', text:'接收TA值30级以上比例'}]);
		 
		 $('#SacchType').combotree('loadData', [
		    	{id:'1000', text:'下行接收电平', "state":"closed", children: [{
		    		id: 1, text: '下行接收电平0级比例'
		    	},{
		    		id: 2, text: '下行接收电平1级比例'
		    	},{
		    		id: 3, text: '下行接收电平2级比例'
		    	},{
		    		id: 4, text: '下行接收电平3级比例'
		    	},{
		    		id: 5, text: '下行接收电平4级比例'
		    	},{
		    		id: 6, text: '下行接收电平5级比例'
		    	},{
		    		id: 7, text: '下行接收电平6级比例'
		    	},{
		    		id: 8, text: '下行接收电平7级比例'
		    	}]},
		    	{id:'1001', text:'下行接收质量', "state":"closed", children: [{
		    		id: 9, text: '下行接收质量0级比例'
		    	},{
		    		id: 10, text: '下行接收质量1级比例'
		    	},{
		    		id: 11, text: '下行接收质量2级比例'
		    	},{
		    		id: 12, text: '下行接收质量3级比例'
		    	},{
		    		id: 13, text: '下行接收质量4级比例'
		    	},{
		    		id: 14, text: '下行接收质量5级比例'
		    	},{
		    		id: 15, text: '下行接收质量6级比例'
		    	},{
		    		id: 16, text: '下行接收质量7级比例'
		    	}]},
		    	{id:'1002', text:'接收TA值', "state":"closed", children: [{
		    		id: 17, text: '接收TA值0级比例'
		    	},{
		    		id: 18, text: '接收TA值1级比例'
		    	},{
		    		id: 19, text: '接收TA值2级比例'
		    	},{
		    		id: 20, text: '接收TA值3级比例'
		    	},{
		    		id: 21, text: '接收TA值4级比例'
		    	},{
		    		id: 22, text: '接收TA值5级比例'
		    	},{
		    		id: 23, text: '接收TA值6级比例'
		    	},{
		    		id: 24, text: '接收TA值7级比例'
		    	},{
		    		id: 25, text: '接收TA值8级比例'
		    	},{
		    		id: 26, text: '接收TA值9级比例'
		    	},{
		    		id: 27, text: '接收TA值10级比例'
		    	},{
		    		id: 28, text: '接收TA值11级比例'
		    	},{
		    		id: 29, text: '接收TA值12级比例'
		    	},{
		    		id: 30, text: '接收TA值13级比例'
		    	},{
		    		id: 31, text: '接收TA值14级比例'
		    	},{
		    		id: 32, text: '接收TA值15级比例'
		    	},{
		    		id: 33, text: '接收TA值16级比例'
		    	},{
		    		id: 34, text: '接收TA值17级比例'
		    	},{
		    		id: 35, text: '接收TA值18级比例'
		    	},{
		    		id: 36, text: '接收TA值19级比例'
		    	},{
		    		id: 37, text: '接收TA值20级比例'
		    	},{
		    		id: 38, text: '接收TA值21级比例'
		    	},{
		    		id: 39, text: '接收TA值22级比例'
		    	},{
		    		id: 40, text: '接收TA值23级比例'
		    	},{
		    		id: 41, text: '接收TA值24级比例'
		    	},{
		    		id: 42, text: '接收TA值25级比例'
		    	},{
		    		id: 43, text: '接收TA值26级比例'
		    	},{
		    		id: 44, text: '接收TA值27级比例'
		    	},{
		    		id: 45, text: '接收TA值28级比例'
		    	},{
		    		id: 46, text: '接收TA值29级比例'
		    	},{
		    		id: 47, text: '接收TA值30级比例'
		    	},{
		    		id: 48, text: '接收TA值30级以上比例'
		    	}]}
			    ]);
		 
		 $('#SignalingType').combotree('loadData', [
			 {id:'1001', text:'电路域信令指标', children: [{
		    		id: 1, text: '信令信道分配成功率'
		    	},{
		    		id: 2, text: '业务信道分配成功率'
		    	},{
		    		id: 3, text: '越区切换成功率（8W）'
		    	},{
		    		id: 4, text: '呼叫接通率'
		    	},{
		    		id: 5, text: '层2消息建立成功率'
		    	},{
		    		id: 6, text: '信令信道分配失败率'
		    	},{
		    		id: 7, text: '位置更新成功率'
		    	},{
		    		id: 8, text: 'CM层业务建立成功率'
		    	},{
		    		id: 9, text: '鉴权成功率'
		    	},{
		    		id: 10, text: '层2拆线次数'
		    	},{
		    		id: 11, text: '层3拆线次数'
		    	},{
		    		id: 12, text: '越区切换空口成功率（8W）'
		    	},{
		    		id: 13, text: '越区切换切入成功率（8W）'
		    	}]}
			 ]);

		 $('#GPRSDefaultType').combotree('loadData', [		        
   			 {id:'1003', text:'GPRS信令指标', children: [{
   		    		id: 1, text: 'GPRS附着成功率'
   		    	},{
   		    		id: 2, text: 'GPRS去附着成功率'
   		    	},{
   		    		id: 3, text: 'GPRS附着拒绝'
   		    	},{
   		    		id: 4, text: 'GPRS附着失败'
   		    	},{
   		    		id: 5, text: '路由区更新成功率'
   		    	},{
   		    		id: 6, text: '路由区更新拒绝'
   		    	},{
   		    		id: 7, text: '路由区更新失败'
   		    	},{
   		    		id: 8, text: 'PDP激活成功率'
   		    	},{
   		    		id: 9, text: 'PDP激活拒绝'
   		    	},{
   		    		id: 10, text: 'PDP激活失败'
   		    	},{
   		    		id: 11, text: 'PDP去激活成功率'
   		    	}]}
   			 ]);
		 $('#GPRSFullType').combotree('loadData', [
   			 {id:'1004', text:'GPRS业务指标', children: [{
   		    		id: 1, text: 'GRIS IP地址查询成功率'
   		    	},{
   		    		id: 2, text: 'M-GRIS IP地址查询成功率'
   		    	},{
   		    		id: 3, text: 'GRIS IP地址更新成功率'
   		    	},{
   		    		id: 4, text: 'M-GRIS IP地址更新成功率'
   		    	},{
   		    		id: 5, text: '终端活动性检测成功率'
   		    	},{
   		    		id: 6, text: '车次号信息发送次数'
   		    	},{
   		    		id: 7, text: '列车停稳次数'
   		    	},{
   		    		id: 8, text: '列车启动次数'
   		    	},{
   		    		id: 9, text: '总调度命令发送总次数'
   		    	},{
   		    		id: 10, text: '总调度命令发送条数'
   		    	},{
   		    		id: 11, text: '总调度命令重发次数'
   		    	},{
   		    		id: 12, text: '总调度命令发送成功条数'
   		    	},{
   		    		id: 13, text: '总调度命令发送失败条数'
   		    	},{
   		    		id: 14, text: '调度命令发送条数'
   		    	},{
   		    		id: 15, text: '调度命令重发次数'
   		    	},{
   		    		id: 16, text: '调度命令自动确认条数'
   		    	},{
   		    		id: 17, text: '调度命令手动签收条数'
   		    	},{
   		    		id: 18, text: '调度命令发送成功条数'
   		    	},{
   		    		id: 19, text: '调度命令发送失败条数'
   		    	},{
   		    		id: 20, text: '调度命令发送成功率'
   		    	},{
   		    		id: 21, text: '调度命令重发率'
   		    	},{
   		    		id: 22, text: '进路预告发送条数'
   		    	},{
   		    		id: 23, text: '进路预告重发次数'
   		    	},{
   		    		id: 24, text: '进路预告自动确认条数'
   		    	},{
   		    		id: 25, text: '进路预告手动签收条数'
   		    	},{
   		    		id: 26, text: '进路预告发送成功条数'
   		    	},{
   		    		id: 27, text: '进路预告发送失败条数'
   		    	},{
   		    		id: 28, text: '进路预告发送成功率'
   		    	},{
   		    		id: 29, text: '进路预告重发率'
   		    	},{
   		    		id: 30, text: '红色许可证发送总次数'
   		    	},{
   		    		id: 31, text: '绿色许可证发送总次数'
   		    	},{
   		    		id: 32, text: '调车作业通知单发送总次数'
   		    	},{
   		    		id: 33, text: '调车请求确认发送总次数'
   		    	},{
   		    		id: 34, text: '出入库检测总次数'
   		    	}]}
   			 ]);		 
		 $('#ServiceType').combotree('loadData', [
			 {id:'1002', text:'C3业务指标', children: [{
		    		id: 1, text: 'HDLC建立成功率'
		    	},{
		    		id: 2, text: '安全层建立成功率'
		    	},{
		    		id: 3, text: '传输层建立成功率'
		    	},{
		    		id: 4, text: '传输层释放成功率'
		    	},{
		    		id: 5, text: 'HDLC重传次数'
		    	},{
		    		id: 6, text: 'HDLC错帧次数'
		    	},{
		    		id: 7, text: 'C3业务建立成功率'
		    	},{
		    		id: 8, text: 'C3业务紧急停车次数'
		    	},{
		    		id: 9, text: 'C3业务紧急停车成功率'
		    	},{
		    		id: 10, text: 'C3业务正常中止成功率'
		    	},{
		    		id: 11, text: 'C3业务异常中断率'
		    	}]}
			]);
		 
	});
	
	
	
	formatterDate = function (date) {
    	var day = date.getDate();
    	var month = (date.getMonth() + 1);
    	var hor = date.getHours();
    	var min = date.getMinutes();
    	var sec = date.getSeconds();
    	return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
    };
</script>
</head>
<body style="margin: 1px">
<table id="dg" title="网络性能分析" class="easyui-datagrid"
   fitColumns="fasle" pagination="true" rownumbers="true" pageSize="100" pageList="[100,200,300,400,500]"
   url="${pageContext.request.contextPath}/networkanalysis/list.do" fit="true" toolbar="#tb">
   <thead>
   	<tr>
   		<th field="cb" checkbox="true" align="center"></th>
   		<th field="bsName" width="80" align="center">前置机名称</th>
   		<th field="bsCI" width="80" align="center">前置机小区CI</th>
   		<th field="date" width="150" align="center">日期</th>
   		<th field="timeslot" width="150" align="center">时间段</th>
   		<th field="index_name" width="200" align="center">指标名称</th>
   		<th field="index_num" width="80" align="center">指标分子</th>
   		<th field="index_deno" width="80" align="center" >指标分母</th>
   		<th field="index_value" width="80" align="center" sortable="true" >指标</th>  		
   	</tr>
   </thead>
 </table>	
 
 

 <div id="tb">
    <div>
    	<a href="javascript:exportCurrentPage()" class="easyui-linkbutton" iconCls="icon-save" plain="true">导出当前记录</a>
    </div>
    <div>
     	&nbsp;时间：&nbsp;<input type="text" id="i1" size="20" class="easyui-datetimebox" style="width:150px" />&nbsp;至&nbsp;
		<input type="text" id="i2" size="20" class="easyui-datetimebox"  style="width:150px" />
    	&nbsp;&nbsp;小区：<select id="district" class="easyui-combotree" style="width:150px;" data-options="panelHeight:'auto', panelMaxHeight:'240px'" multiple></select>
    	&nbsp;测量报告指标：&nbsp;		
		<select id="SacchType" class="easyui-combotree" style="width:190px;" data-options="panelHeight:'auto', panelMaxHeight:'240px'" multiple></select>
		&nbsp;电路域信令指标：&nbsp;		
		<select id="SignalingType" class="easyui-combotree" style="width:225px;" data-options="panelHeight:'auto', panelMaxHeight:'240px'" multiple></select>
		&nbsp;C3业务指标：&nbsp;		
		<select id="ServiceType" class="easyui-combotree" style="width:200px;" data-options="panelHeight:'auto', panelMaxHeight:'240px'" multiple></select>
 		&nbsp;GPRS信令指标：&nbsp;		
		<select id="GPRSDefaultType" class="easyui-combotree" style="width:180px;" data-options="panelHeight:'auto', panelMaxHeight:'240px'" multiple></select>
		&nbsp;GPRS业务指标：&nbsp;		
		<select id="GPRSFullType" class="easyui-combotree" style="width:235px;" multiple></select> 
		
<!--  		&nbsp;小区：&nbsp; -->
<%--  		<input class="easyui-combobox" id="frontId" name="frontId" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/frontId.do'" value="-1"/>    --%>
<!--  		&nbsp;测量报告指标：&nbsp; -->
<%--  		<input class="easyui-combobox" id="type" name="type" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/sacchlist.do'" value="-1"/> --%>
<!--  		&nbsp;电路域信令指标：&nbsp; -->
<%--  		<input class="easyui-combobox" id="type" name="type" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/signalinglist.do'" value="-1"/> --%>
<!--  		&nbsp;C3业务指标：&nbsp; -->
<%--  		<input class="easyui-combobox" id="type" name="type" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/servicelist.do'" value="-1"/> --%>

		&nbsp;时间强度：&nbsp;
     	<input class="easyui-combobox" id="timegap" name="timegap" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/timegaplist.do'" value="15分钟"/> 
     	&nbsp;是否合并小区：&nbsp;
     	<input class="easyui-combobox" id="judge" name="judge" data-options="panelHeight:'auto',valueField:'id',textField:'name',url:'${pageContext.request.contextPath}/networkanalysis/judgelist.do'" value="否"/>   
 		<a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search" plain="true">查询</a>
 	</div>
 	
 </div>
	
</body>
</html>